public class ArraySum{
	public static int[][] addMatrix(int[][] m1, int[][] m2){
		int m[][]=new int[m1.length][m1.length];
		for(int i=0;i<m1.length;i++) {
			for(int j=0;j<m1.length;j++) {
				m[i][j]=m1[i][j]+m2[i][j];
			}
		}
		return m;
	}
	public static void main(String[]argv){
	int [][]m1= {{1,2,3,4,5},{4,2,2,8,9},{7,3,2,3,4},{3,4,1,4,6},{7,5,2,5,6}};
		int [][]m2= {{1,2,1,2,1},{2,3,2,2,3},{7,3,3,4,3},{4,5,4,6,4},{7,5,5,2,1}};
		int [][]m=ArraySum.addMatrix(m1, m2);
		for(int i=0;i<m1.length;i++) {
			for(int j=0;j<m1.length;j++) {
				System.out.print(m1[i][j]+" ");
			}
			if(i==2)
				System.out.print("  +");
			System.out.print("\t");
			for(int j=0;j<m2.length;j++) {
				System.out.print(m2[i][j]+" ");
			}
			if(i==2)
				System.out.print("  =");
			System.out.print("\t");
			for(int j=0;j<m.length;j++) {
				System.out.print(m[i][j]+" ");
			}
			System.out.println();
		}
	}
}